<!DOCTYPE html>
<html>
<head>
<meta charset="US-ASCII">
<title>TCC Eugenio - WebSocket</title>
<script type="text/javascript" src="jquery.js"></script>
<script>
	var ws = new WebSocket("ws://localhost:8080/TCCWS/event");
	ws.onopen = function() {
	};
	ws.onopen = function() {
	    console.log("Websocket Ready!!");
	};
	
	ws.onmessage= function(data) {
		var oldData = $("#mainEvent").html();
		$("#mainEvent").html(oldData + "\n" + data.data);
	};
	
	function sendMessage() {
	    ws.send("Starting");
	};
</script>
</head>
<body>
	Acompanhe aqui os lances do jogo.
	<div>
		<br />
		<textarea id="mainEvent" rows="10" cols="10" style="margin: 2px; width: 439px; height: 243px;"></textarea>
	</div>
	<a href="javascript:void(0);" onclick="sendMessage();">Comecar</a>
	<a href="event?reset=true">Recomecar</a>
</body>
</html>